﻿//---------------------------------------------------------------------------
// <copyright file="RibbonGroupPanel.cs" company="Microsoft Corporation">
//     Copyright (C) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------------

namespace Microsoft.Windows.Controls.Ribbon
{
    using System.Windows;
    using System.Windows.Controls;

    /// <summary>
    ///   The default panel for the RibbonGroup class.
    /// </summary>
    public class RibbonGroupPanel : WrapPanel
    {
        /// <summary>
        ///   Initializes static members of the RibbonGroupPanel class.
        /// </summary>
        static RibbonGroupPanel()
        {
            OrientationProperty.OverrideMetadata(typeof(RibbonGroupPanel), new FrameworkPropertyMetadata(Orientation.Vertical));
        }

        /// <summary>
        ///   Returns a collection of the panels elements.
        /// </summary>
        /// <param name="logicalParent">The logical parent of the collection to be created.</param>
        /// <returns>Returns an ordered collection of elements that have the specified logical parent.</returns>
        protected override UIElementCollection CreateUIElementCollection(FrameworkElement logicalParent)
        {
            return new UIElementCollection(this, this.TemplatedParent as FrameworkElement);

            // TODO: Logical tree connections then collection changes - do not rely on Panel
            // return new UIElementCollection(this, TemplatedParent == null ? logicalParent : null);
        }
    }
}